<%--
  Created by IntelliJ IDEA.
  User: 14811
  Date: 2022-5-2
  Time: 19:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/common/common.jsp"%>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript">
        function addFavorite(rid) {
            $.ajax({
                url : "<%=path%>/collectController/test",
                dataType : "json",
                type : "post",
                date:{rid:rid},
                success : function (data) {
                    //console.log(data);
                    //alert(count)
                    if (data){
                        toastr.success("收藏成功");
                    }else {
                        toastr.error("一个用户只能收藏一次")
                    }

                }
            })
        }
    </script>
</head>

<body>
<button type="button" onclick="addFavorite(5)">测试</button>
</body>

</html>
